<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function People(name){
            this.name = name;
        }
        People.prototype.showName = function(){
            console.log(this.name);
        }
        function Student(){

        }
        Student.prototype = new People("zhangsan");

        Student.prototype.study = function(){
            console.log("学习");
        }
        var stu = new Student();
        //stu.study();
        //stu.showName();

        //Student.prototype
        //console.dir(stu.__proto__===Student.prototype)
       // console.dir(Student.prototype.__proto__===People.prototype)
        //console.dir(stu.__proto__.__proto__===People.prototype)//原型链
        //原型链的最终指向
       // console.dir( stu.__proto__);
        //console.dir(Student.prototype)
       // console.dir(People.prototype.__proto__.__proto__)//原型链终止
       console.dir(stu.__proto__.__proto__.__proto__.__proto__)
       //console.log(typeof stu.__proto__.__proto__.__proto__)
       // Student.prototype
       // People.prototype
       // Object.prototype
       //null
    </script>
</head>
<body>
    
</body>
</html>